<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">SVMCLASS</b>
<td valign="baseline" align="right" class="function"><a href="../svm/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>Support Vector Machines Classifier.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;[y,dfce]&nbsp;=&nbsp;svmclass(&nbsp;X,&nbsp;model&nbsp;)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;[y,dfce]&nbsp;=&nbsp;svmclass(&nbsp;X,&nbsp;model&nbsp;)&nbsp;classifies&nbsp;input&nbsp;vectors&nbsp;X</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;into&nbsp;classes&nbsp;using&nbsp;the&nbsp;multi-class&nbsp;SVM&nbsp;classifier</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y(i)&nbsp;=&nbsp;argmax&nbsp;f_j(X(:,i))</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;j=1..nfun</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;f_j&nbsp;are&nbsp;linear&nbsp;functions&nbsp;in&nbsp;the&nbsp;feature&nbsp;space&nbsp;given&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;by&nbsp;the&nbsp;prescribed&nbsp;kernel&nbsp;function&nbsp;(options.ker,&nbsp;options.arg).&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;discriminant&nbsp;functions&nbsp;f_j&nbsp;are&nbsp;determined&nbsp;by&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[nsv&nbsp;x&nbsp;nfun]&nbsp;...&nbsp;multipliers&nbsp;associated&nbsp;to&nbsp;SV</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.b&nbsp;[nclass]&nbsp;...&nbsp;biases&nbsp;of&nbsp;discriminant&nbsp;functions.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.sv.X&nbsp;[dim&nbsp;x&nbsp;nsv]&nbsp;...&nbsp;support&nbsp;vectors.</span><br>
<span class=help>&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;'help&nbsp;kernelproj'&nbsp;for&nbsp;more&nbsp;info&nbsp;about&nbsp;valuation&nbsp;of&nbsp;the&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;discriminant&nbsp;functions&nbsp;f_j.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;In&nbsp;the&nbsp;binary&nbsp;case&nbsp;nfun=1&nbsp;the&nbsp;binary&nbsp;SVM&nbsp;classifier&nbsp;is&nbsp;used</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y(i)&nbsp;=&nbsp;1&nbsp;if&nbsp;f(X(:,i)&nbsp;&gt;=&nbsp;0</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=&nbsp;2&nbsp;if&nbsp;f(X(:,i)&nbsp;&lt;&nbsp;0</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;f&nbsp;is&nbsp;the&nbsp;disrimiant&nbsp;function&nbsp;given&nbsp;by&nbsp;Alpha&nbsp;[nsv&nbsp;x&nbsp;1],</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;b&nbsp;[1x1]&nbsp;and&nbsp;support&nbsp;vectors&nbsp;sv.X.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Input&nbsp;vectors&nbsp;to&nbsp;be&nbsp;classified.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;SVM&nbsp;classifier:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[nsv&nbsp;x&nbsp;nfun]&nbsp;Multipliers&nbsp;associated&nbsp;to&nbsp;suport&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[nfun&nbsp;x&nbsp;1]&nbsp;Biases.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.sv.X&nbsp;[dim&nbsp;x&nbsp;nsv]&nbsp;Support&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.options.ker&nbsp;[string]&nbsp;Kernel&nbsp;identifier.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.options.arg&nbsp;[1&nbsp;x&nbsp;nargs]&nbsp;Kernel&nbsp;argument(s).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Predicted&nbsp;labels.</span><br>
<span class=help>&nbsp;&nbsp;dfce&nbsp;[nfun&nbsp;x&nbsp;num_data]&nbsp;Values&nbsp;of&nbsp;discriminant&nbsp;functions.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;trn&nbsp;=&nbsp;load('riply_trn');</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;smo(trn,struct('ker','rbf','arg',1,'C',10));</span><br>
<span class=help>&nbsp;&nbsp;tst&nbsp;=&nbsp;load('riply_tst');</span><br>
<span class=help>&nbsp;&nbsp;ypred&nbsp;=&nbsp;svmclass(&nbsp;tst.X,&nbsp;model&nbsp;);</span><br>
<span class=help>&nbsp;&nbsp;cerror(&nbsp;ypred,&nbsp;tst.y&nbsp;)</span><br>
<span class=help>&nbsp;</span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../svm/smo.html" target="mdsbody">SMO</a>,&nbsp;<a href = "../svm/svmlight.html" target="mdsbody">SVMLIGHT</a>,&nbsp;<a href = "../svm/svmquadprog.html" target="mdsbody">SVMQUADPROG</a>,&nbsp;<a href = "../kernels/kfd.html" target="mdsbody">KFD</a>,&nbsp;KFDQP,&nbsp;<a href = "../svm/mvsvmclass.html" target="mdsbody">MVSVMCLASS</a>.  </span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../svm/list/svmclass.html">svmclass.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2003, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 14-may-2004, VF<br>
 09-May-2003, VF<br>
 14-Jan-2003, VF<br>

</body>
</html>
